import request from "../request";

export type Banner = {
  _id: string;
  sort: number;
  target: string;
  picurl: string;
  url: string;
  appid: string;
};

export const getBannerService = async () => {
  const res = await request({
    url: "api/bizhi/homeBanner",
    method: "GET",
  }).then((r) => r);
  return res;
};

export const getDayRecommendService = async () => {
  const res = await request({
    url: "api/bizhi/randomWall",
    method: "GET",
  }).then((r) => r);
  return res;
};

export const getSystemNoticeService = async () => {
  const res = await request({
    url: "api/bizhi/wallNewsList",
    method: "GET",
    data: {
      select: true,
    },
  }).then((r) => r);
  return res;
};

export const getAllWallpaperClassifyService = async (params: {
  pageNum?: number;
  pageSize?: number;
  select?: boolean;
}) => {
  const res = await request({
    url: "api/bizhi/classify",
    method: "GET",
    data: params,
  }).then((r) => r);
  return res;
};

export const getWallpaperOfClassifyService = async (params: {
  classid: string;
  pageNum?: number;
  pageSize?: number;
}) => {
  return request({
    url: "api/bizhi/wallList",
    method: "GET",
    data: params,
  }).then((r) => r);
};
